package com.scenic.rd_android;

import android.os.Bundle;

import com.nova.scenic.projectlibs.util.StringUtil;
import com.nova.scenic.projectlibs.util.debug.MyLog;

/**
 * Created by scenic on 16/5/27.
 */
public class BaseActivity extends com.nova.scenic.projectlibs.util.BaseActivity {

    MyLog myLog = new MyLog("BaseActivity ");

    MyLog.StackTraceRange traceRange = new MyLog.StackTraceRange() {
        @Override
        public int getStart() {
            return MyLog.STACK_TRACE_RANGE_ANDROID.getStart() + 1;
        }

        @Override
        public int size() {
            return MyLog.STACK_TRACE_RANGE_ANDROID.size();
        }
    };


    {
        myLog.setStackTraceRange(traceRange);
        myLog.setPattern(MyLog.PATTERN_ALL);
    }
    protected void log(Object o){
        myLog.info(o);
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (StringUtil.isStringEmpty(getTitle()) || getTitle().equals(getString(R.string.app_name))) {
            String tmpStrin = this.getClass().getSimpleName();
            setTitle(tmpStrin);
        }

        myLog.info("onCreate");
    }

}
